<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%-- 引入页面头 --%>
<%@ include file="/pageHead.jsp" %>

<form name="form1" id="form1" action="" method="post">
 
	<div class="pageMain">
	<div class="pageTitle">
	<%=MessageResourcesUtils.getMessage(request, "systemmanage.bascsetting.title") %><span></span>
	<%=MessageResourcesUtils.getMessage(request, "systemmanage.usermaintain.title") %><span></span>
	<%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.title") %>
	</div>
	<div class="pageBody">
				<div class="form-group">
					<ul>
						<li>
							<i>*</i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.usercode") %></label>
							<span><input type="text" id="userno" name="userno" maxlength="50" size="22" class="validate[required]" /></span>
						</li>
						<li>
							<i>*</i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.userloginname") %></label>
							<span><input type="text" id="loginname" name="loginname" maxlength="50" size="22" class="validate[required]" /></span>
						</li>
					</ul>
					<ul>
						<li>
							<i>*</i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.userpwd") %></label>
							<span><input type="text" onfocus="this.type='password'" id="password" name="password" maxlength="20" size="22" class="validate[required]" /></span>
						</li>
						<li>
							<i>*</i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.username") %>：</label>
							<span><input type="text" id="username" name="username" maxlength="50" size="22" class="validate[required]" /></span>
						</li>
					</ul>
					<ul>
						<li>
							<i>*</i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.validstart") %></label>
							<span><input type="text" class="validate[required,custom[date]]" id="validstart" name="validstart" value="" /></span>
						</li>
						<li>
							<i>*</i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.validend") %></label>
							<span><input type="text" class="validate[required,custom[date]]" id="validend" name="validend" value="" /></span>
						</li>
					</ul>
					<ul>
						<li>
							<i></i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.certsn") %></label>
							<span><input type="text" id="certsn" name="certsn" maxlength="50" size="22" class="validate[]" /></span>
						</li>
						<li>
							<i></i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.certcn") %></label>
							<span><input type="text" id="certcn" name="certcn" maxlength="50" size="22" class="validate[]" /></span>
						</li>
					</ul>
					<ul>
						<li>
							<i></i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.officephone") %></label>
							<span><input type="text" id="officephone" name="officephone" maxlength="50" size="22" class="validate[]" /></span>
						</li>
						<li>
							<i></i>
							<label><%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.phone") %></label>
							<span><input type="text" id="phone" name="phone" maxlength="50" size="22" class="validate[custom[phone]]" /></span>
						</li>
					</ul>
					<ul>
						<li>
							<i>*</i>
							<label>EMAIL</label>
							<span><input type="text" id="email" name="email" maxlength="50" size="22" class="validate[required,custom[email],maxSize[30]]" /></span>
						</li>
						<li>
						
						</li>
					</ul>
				</div>
				<div class="button-group">
					<input type="button" class="btn btn-default" id="butSave" name="butSave" value="<%=MessageResourcesUtils.getMessage(request, "common.button.save") %>" />
	       			<input type="reset" class="btn btn-default" id="butClean" name="butClean" value="<%=MessageResourcesUtils.getMessage(request, "common.button.clear") %>" />
	       			<input type="button" class="btn btn-default" id="butReturn" name="butReturn" value="<%=MessageResourcesUtils.getMessage(request, "common.button.back") %>" />
				</div>
	</div>
	</div>
</form>

<script type="text/javascript">	

$(document).ready(function() {
	$('#validstart').date_input();
	$('#validend').date_input();

	
	$('#butSave').click(function() {
		var exp = $('#form1').validationEngine('validate');
		var validstart = $('#validstart').val();
		var validend = $('#validend').val();
		validstart = validstart.replace(/\-/gi,"/");
		validend = validend.replace(/\-/gi,"/");
		var time1 = new Date(validstart).getTime();
		var time2 = new Date(validend).getTime();
		if(time1>=time2){
			alert("<%=MessageResourcesUtils.getMessage(request, "systemmanage.User.add.date") %>");
			return;
		}
		if(exp==true){
			if(confirm('<%=MessageResourcesUtils.getMessage(request, "common.button.checksave") %>')) 
			{
				// 显示进度条
				showSending();
				$.ajax({
					type: 'POST',
				    url: '${systemctx}/systemmanage/user/validattionUser.json',
				    data: $("#form1").serialize(),
				    dataType: 'json',
				    success: function(data)
				    {
				    	//关闭执行...
						closeSending();
				    	if (data.messagetype == '2')
				    	{
				    		//显示AJAX请求后的提示信息
							$.fn.ajaxmessage(data);
				    	}
				    	else
				    	{
				    		form1.action="${systemctx}/systemmanage/user/addUser.web";
							form1.submit();
				    	}
				    }
				});
			}
		}
				
	});
	
	/* $('#butClean').click(function() {
		$('#userno').val('');		
		$('#loginname').val('');		
		$('#username').val('');		
		$('#validstart').val('');		
		$('#validend').val('');		
		$('#certsn').val('');		
		$('#certcn').val('');		
		$('#officephone').val('');		
		$('#phone').val('');		
		$('#email').val('');		
	}); */
	
	$('#butReturn').click(function() {
		parent.document.location.reload();
	    $.fn.closeIssWindow();
		
	});
	
});

</SCRIPT>

<%-- 引入页面尾 --%>
<%@ include file="/pageFloor.jsp" %>